/**
 * Created by Wen Gao on 2017/6/1.
 */

/* promise new出来会直接
let p = new Promise(function(resolve, reject){
    //做一些异步操作
    setTimeout(function(){
        console.log('执行完成');
        resolve('随便什么数据');
    }, 2000);
});
*/

function runAsync(){
    return new Promise((resolve, reject) =>{
        //做一些异步操作
        setTimeout(function(){
            console.log('执行完成');
            resolve('随便什么数据');
        }, 2000);
    });
}


runAsync().then((data)=> {
    console.log(data);
});
